package com.ciwong.epaper.modules.me.ui;

import android.view.View;

import com.ciwong.epaper.R;
import com.ciwong.epaper.application.EApplication;
import com.ciwong.epaper.application.EpaperConstant;
import com.ciwong.epaper.modules.cordva.BaseHtmlActicity;
import com.ciwong.epaper.modules.me.util.MeJumpManager;
import com.ciwong.epaper.util.HttpRequest;
import com.ciwong.epaper.util.RequestCode;
import com.ciwong.libs.utils.CWLog;
import com.ciwong.libs.utils.volley.BaseRequest;
import com.ciwong.mobilelib.i.ViewOnClickListener;

import java.io.UnsupportedEncodingException;

/**
 * Created by Administrator on 2017/8/31.
 * 我的成绩
 */

public class MineGradeActivity extends BaseHtmlActicity {
    private String clientId;
    private String userId;

    @Override
    protected void loadData() {
        super.loadData();
        BaseRequest.VerifyInfo verifyInfo = HttpRequest.getVerifyInfo();
        if (verifyInfo != null) {
            clientId = verifyInfo.getClientId();
            userId = String.valueOf(EApplication.getInstance().getUserInfoBase().getUserId());
        }
        String url = EpaperConstant.URL_H5_MINE_GRADE + "clientId=" + clientId + "&userId=" + userId + "&brandId=" + EApplication.BRAND_ID;
        setStartURL(url);
        loadUrl(startURL.toString());
        setRightBtnText("学习记录", R.color.book_case_title);
        setRightBtnListener(new ViewOnClickListener() {
            @Override
            public void avertRepeatOnClick(View v) {
                MeJumpManager.jumpToStudyRecordH5Activity(1, MineGradeActivity.this, R.string.go_back,
                        RequestCode.MainActivityResquestCode.REQUEST_CODE_TO_WORK_LIST, "", "", 0);
            }
        });
    }

    @Override
    public void finish() {
        if (webView.canGoBack()) {
            webView.goBack();
            return;
        }
        super.finish();
    }
}
